print-editor: Fix a wrong comparison
authorTimm Bäder <mail@baedert.org>
Thu, 15 Oct 2020 04:05:39 +0000 (06:05 +0200)
committerTimm Bäder <mail@baedert.org>
Thu, 22 Oct 2020 15:46:33 +0000 (17:46 +0200)
If error is NULL, replacing the file contents worked and we don't
show the error dialog. The previous version pretty explicitly
dereferenced a NULL pointer by first ensuring that error is NULL and
then accessing error->message.

Found by scan-build

demos/print-editor/print-editor.c

index 416ff9db31946993e24ee69d8a845c00dc7ae4d9..a0c8da320db46f4300c84b759ab0ab2f89824266 100644 (file)
@@ -164,7 +164,7 @@ save_file (GFile *save_filename)
                            NULL,
                            &error);
 
-  if (error != NULL)
+  if (error == NULL)
     {
       if (save_filename != filename)
        {